<!DOCTYPE html>
<html>
<head>
	<meta content="text/html;charset=UTF-8"/>
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
	<meta http-equiv ="Pragma" content = "no-cache"/>
	<meta http-equiv="Cache-Control" content="no cache" />
	<meta http-equiv="Expires" content="0" />
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
	<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
	<meta name="apple-mobile-web-app-capable" content="yes"/>
	<meta name="format-detection" content="telephone=no"/>
	<script src="https://cdn.bootcss.com/pace/1.0.2/pace.min.js"></script>
	<link href="https://cdn.bootcss.com/pace/1.0.2/themes/pink/pace-theme-flash.css" rel="stylesheet">
	<link rel="stylesheet" type="text/css" href="${ctxPath!}/plugins/layui/css/layui.css" media="all"/>
	<link rel="stylesheet" type="text/css" href="${ctxPath!}/css/fs.css" media="all"/>
	<script type="text/javascript" src="${ctxPath!}/plugins/layui/layui.js"></script>
	<script type="text/javascript" src="${ctxPath!}/plugins/jquery/jquery.min.js"></script>
	<script type="text/javascript" src="${ctxPath!}/plugins/tinymce/tinymce.min.js"></script>
	<script type="text/javascript" src="${ctxPath!}/plugins/tinymce/jquery.tinymce.min.js"></script>
	<script type="text/javascript" src="${ctxPath!}/plugins/frame/js/fsDict.js?v=1.5.0"></script>
	<script type="text/javascript" src="${ctxPath!}/plugins/frame/js/fs.js?v=1.5.0"></script>
	<script type="text/javascript" src="${ctxPath!}/plugins/frame/js/frame.js?v=1.5.0"></script>
</head>
<body>
	<div class="layui-fluid">

	<form class="layui-form">
		<input type="hidden" name="icon"/>
		<div class="layui-form-item">
			<label class="layui-form-label">名称</label>
			<div class="layui-input-block">
				<input  type="text" name="name" required="" lay-verType="tips" lay-verify="required" placeholder="请输入名称" autocomplete="off" class="layui-input"/>
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">权限代码</label>
			<div class="layui-input-block">
				<input  type="text" name="permission" required="" lay-verType="tips" lay-verify="required" placeholder="请输入名称" autocomplete="off" class="layui-input"/>
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">地址</label>
			<div class="layui-input-block">
				<input type="text" name="url" required="" lay-verType="tips" lay-verify="" placeholder="请输入名称" autocomplete="off" class="layui-input"/>
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">图标</label>
			<div class="layui-input-block">
				<input type="text" id="iconPicker" lay-filter="iconPicker"  class="layui-input">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">父级</label>
			<div class="layui-input-inline">
				<select  name="parentid" lay-verify="required" lay-verType="tips" class="fsSelect" dict="menu" addNull="1">
				</select>
			</div>
		</div>

	  <hr/>
	  <div class="layui-form-item" style="text-align: center;">
	      <button class="layui-btn" lay-submit="" lay-filter="save" url="/coreMenu/add.do">新增</button>
	      <button type="button" class="layui-btn layui-btn-primary" function="close">关闭</button>
	  </div>
	</form>
	</div>
	<script type="text/javascript">
        layui.use(['iconPicker'], function () {
            var $ = layui.jquery,
             iconPicker = layui.iconPicker;

            iconPicker.render({
                // 选择器，推荐使用input
                elem: '#iconPicker',
                // 数据类型：fontClass/unicode，推荐使用fontClass
                type: 'fontClass',
                // 是否开启搜索：true/false
                search: false,
                // 点击回调
                click: function (data) {
                    console.log(data);
                    $(" input[ name='icon'] ").val(data.icon);
                }
            });

            /**
             * 选中图标 （常用于更新时默认选中图标）
             * @param filter lay-filter
             * @param iconName 图标名称，自动识别fontClass/unicode
             */
            iconPicker.checkIcon('iconPicker', '');

        });
	</script>
</body>
</html>
